Optimal. Leaf size=57 \[ \frac {\left (a^2-b^2\right ) \log (\cos (x))}{a^3}-\frac {\left (a^2-b^2\right ) \log (a+b \cos (x))}{a^3}-\frac {b \sec (x)}{a^2}+\frac {\sec ^2(x)}{2 a} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 57, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {2800, 908}
\begin {gather*} -\frac {b \sec (x)}{a^2}+\frac {\left (a^2-b^2\right ) \log (\cos (x))}{a^3}-\frac {\left (a^2-b^2\right ) \log (a+b \cos (x))}{a^3}+\frac {\sec ^2(x)}{2 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 908
Rule 2800
Rubi steps
\begin {align*} \int \frac {\tan ^3(x)}{a+b \cos (x)} \, dx &=-\text {Subst}\left (\int \frac {b^2-x^2}{x^3 (a+x)} \, dx,x,b \cos (x)\right )\\ &=-\text {Subst}\left (\int \left (\frac {b^2}{a x^3}-\frac {b^2}{a^2 x^2}+\frac {-a^2+b^2}{a^3 x}+\frac {a^2-b^2}{a^3 (a+x)}\right ) \, dx,x,b \cos (x)\right )\\ &=\frac {\left (a^2-b^2\right ) \log (\cos (x))}{a^3}-\frac {\left (a^2-b^2\right ) \log (a+b \cos (x))}{a^3}-\frac {b \sec (x)}{a^2}+\frac {\sec ^2(x)}{2 a}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.11, size = 46, normalized size = 0.81 \begin {gather*} \frac {2 \left (a^2-b^2\right ) (\log (\cos (x))-\log (a+b \cos (x)))-2 a b \sec (x)+a^2 \sec ^2(x)}{2 a^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.11, size = 58, normalized size = 1.02
method | result | size |
default | \(-\frac {\left (a^{2}-b^{2}\right ) \ln \left (a +b \cos \left (x \right )\right )}{a^{3}}-\frac {b}{a^{2} \cos \left (x \right )}+\frac {\left (a^{2}-b^{2}\right ) \ln \left (\cos \left (x \right )\right )}{a^{3}}+\frac {1}{2 a \cos \left (x \right )^{2}}\) | \(58\) |
risch | \(-\frac {2 \left (b \,{\mathrm e}^{3 i x}-a \,{\mathrm e}^{2 i x}+b \,{\mathrm e}^{i x}\right )}{\left ({\mathrm e}^{2 i x}+1\right )^{2} a^{2}}+\frac {\ln \left ({\mathrm e}^{2 i x}+1\right )}{a}-\frac {\ln \left ({\mathrm e}^{2 i x}+1\right ) b^{2}}{a^{3}}-\frac {\ln \left ({\mathrm e}^{2 i x}+\frac {2 a \,{\mathrm e}^{i x}}{b}+1\right )}{a}+\frac {\ln \left ({\mathrm e}^{2 i x}+\frac {2 a \,{\mathrm e}^{i x}}{b}+1\right ) b^{2}}{a^{3}}\) | \(117\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 56, normalized size = 0.98 \begin {gather*} -\frac {{\left (a^{2} - b^{2}\right )} \log \left (b \cos \left (x\right ) + a\right )}{a^{3}} + \frac {{\left (a^{2} - b^{2}\right )} \log \left (\cos \left (x\right )\right )}{a^{3}} - \frac {2 \, b \cos \left (x\right ) - a}{2 \, a^{2} \cos \left (x\right )^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.43, size = 66, normalized size = 1.16 \begin {gather*} -\frac {2 \, {\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} \log \left (-b \cos \left (x\right ) - a\right ) - 2 \, {\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} \log \left (-\cos \left (x\right )\right ) + 2 \, a b \cos \left (x\right ) - a^{2}}{2 \, a^{3} \cos \left (x\right )^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\tan ^{3}{\left (x \right )}}{a + b \cos {\left (x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.45, size = 66, normalized size = 1.16 \begin {gather*} \frac {{\left (a^{2} - b^{2}\right )} \log \left ({\left | \cos \left (x\right ) \right |}\right )}{a^{3}} - \frac {{\left (a^{2} b - b^{3}\right )} \log \left ({\left | b \cos \left (x\right ) + a \right |}\right )}{a^{3} b} - \frac {2 \, a b \cos \left (x\right ) - a^{2}}{2 \, a^{3} \cos \left (x\right )^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.60, size = 115, normalized size = 2.02 \begin {gather*} -\frac {2\,a^2\,\mathrm {atanh}\left (\frac {a\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2}{-b\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2+a+b}\right )-2\,b^2\,\mathrm {atanh}\left (\frac {a\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2}{-b\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2+a+b}\right )}{a^3}-\frac {2\,a\,b-{\mathrm {tan}\left (\frac {x}{2}\right )}^2\,\left (2\,a^2+2\,b\,a\right )}{a^3\,{\mathrm {tan}\left (\frac {x}{2}\right )}^4-2\,a^3\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2+a^3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________